namespace SmartSoft.Lists
{
    using SmartSoft;
    using SmartSoft.Controls;
    using SmartSoft.ADP;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms;

    public class FormDmHdEditor : FormListEditor
    {
        private IContainer components;
        private LabelControl lblLoai_Hd;
        private LabelControl lblMa_Dt;
        private LabelControl lblMa_Hd;
        private LabelControl lblNgay_Hd1;
        private LabelControl lblNgay_Hd2;
        private LabelControl lblNgay_Ky;
        private LabelControl lblPT_Lai;
        private LabelControl lblPT_Lai1;
        private LabelControl lblTen_Hd;
        private LabelControl lblTen_Hd_E;
        private LabelControl lblTk;
        private LabelControl lblTk_Nt0;
        private LabelControl lblTTien;
        private LabelControl lblTTien_Nt;
        private LabelControl lblTTien_Nt0;
        private LabelControl lblTTien0;
        private TextOption txtLoai_Hd;
        private TextSearch txtMa_Dt;
        private TextControl txtMa_Hd;
        private TextDate txtNgay_Hd1;
        private TextDate txtNgay_Hd2;
        private TextDate txtNgay_Ky;
        private TextNumeric txtPT_Lai;
        private TextNumeric txtPT_Lai1;
        private TextControl txtTen_Dt;
        private TextControl txtTen_Hd;
        private TextControl txtTen_Hd_E;
        private TextControl txtTen_Tk;
        private TextSearch txtTk;
        private TextNumeric txtTTien;
        private TextNumeric txtTTien_Nt;
        private TextNumeric txtTTien_Nt0;
        private TextNumeric txtTTien0;

        public FormDmHdEditor()
        {
            this.InitializeComponent();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            //ComponentResourceManager manager = new ComponentResourceManager(typeof(FormDmHdEditor));
            this.txtMa_Hd = new TextControl();
            this.lblMa_Hd = new LabelControl();
            this.txtTen_Hd = new TextControl();
            this.lblTen_Hd = new LabelControl();
            this.txtTen_Hd_E = new TextControl();
            this.lblTen_Hd_E = new LabelControl();
            this.lblLoai_Hd = new LabelControl();
            this.txtLoai_Hd = new TextOption();
            this.txtTk = new TextSearch();
            this.txtTen_Tk = new TextControl();
            this.lblTk = new LabelControl();
            this.lblTk_Nt0 = new LabelControl();
            this.lblMa_Dt = new LabelControl();
            this.txtMa_Dt = new TextSearch();
            this.txtTen_Dt = new TextControl();
            this.txtNgay_Ky = new TextDate();
            this.lblNgay_Ky = new LabelControl();
            this.txtTTien0 = new TextNumeric();
            this.txtTTien = new TextNumeric();
            this.txtNgay_Hd1 = new TextDate();
            this.txtPT_Lai = new TextNumeric();
            this.lblTTien0 = new LabelControl();
            this.lblTTien = new LabelControl();
            this.lblNgay_Hd1 = new LabelControl();
            this.lblPT_Lai = new LabelControl();
            this.lblTTien_Nt0 = new LabelControl();
            this.lblTTien_Nt = new LabelControl();
            this.lblNgay_Hd2 = new LabelControl();
            this.lblPT_Lai1 = new LabelControl();
            this.txtNgay_Hd2 = new TextDate();
            this.txtTTien_Nt0 = new TextNumeric();
            this.txtTTien_Nt = new TextNumeric();
            this.txtPT_Lai1 = new TextNumeric();
            base.SuspendLayout();
            base.txtMa_Loai3.FirstFilter = "Type = 'HD3'";
            base.txtMa_Loai3.Location = new Point(0x1b6, 270);
            base.txtMa_Loai3.Size = new Size(0x9b, 20);
            base.txtMa_Loai3.TabIndex = 0x11;
            base.txtMa_Loai2.FirstFilter = "Type = 'HD2'";
            base.txtMa_Loai2.Location = new Point(280, 270);
            base.txtMa_Loai2.Size = new Size(0x9c, 20);
            base.txtMa_Loai2.TabIndex = 0x10;
            base.txtMa_Loai1.FirstFilter = "Type = 'HD1'";
            base.txtMa_Loai1.Location = new Point(0x7b, 270);
            base.txtMa_Loai1.Size = new Size(0x9b, 20);
            base.txtMa_Loai1.TabIndex = 15;
            base.lblPhan_Loai.Location = new Point(12, 0x111);
            this.txtMa_Hd.CharacterCasing = CharacterCasing.Upper;
            this.txtMa_Hd.CheckTextSearched = false;
            this.txtMa_Hd.DisabledForeColor = Color.Empty;
            this.txtMa_Hd.Font = new Font("Arial", 8.25f);
            this.txtMa_Hd.Location = new Point(0x7b, 0x1c);
            this.txtMa_Hd.MaxLength = 0x20;
            this.txtMa_Hd.Name = "txtMa_Hd";
            this.txtMa_Hd.OldValue = null;
            this.txtMa_Hd.Size = new Size(0x9b, 20);
            this.txtMa_Hd.TabIndex = 0;
            this.txtMa_Hd.UserTextLength = AppInstance.TextControlLength.ItemCode;
            this.txtMa_Hd.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtMa_Hd.Value = null;//manager.GetObject("txtMa_Hd.Value");
            this.lblMa_Hd.AutoSize = true;
            this.lblMa_Hd.Font = new Font("Arial", 8.25f);
            this.lblMa_Hd.Location = new Point(12, 0x1f);
            this.lblMa_Hd.Name = "lblMa_Hd";
            this.lblMa_Hd.Size = new Size(70, 14);
            this.lblMa_Hd.TabIndex = 4;
            this.lblMa_Hd.Text = "Mã hợp đồng";
            this.txtTen_Hd.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.txtTen_Hd.CheckTextSearched = false;
            this.txtTen_Hd.DisabledForeColor = Color.Empty;
            this.txtTen_Hd.Font = new Font("Arial", 8.25f);
            this.txtTen_Hd.Location = new Point(0x7b, 50);
            this.txtTen_Hd.MaxLength = 0x80;
            this.txtTen_Hd.Name = "txtTen_Hd";
            this.txtTen_Hd.OldValue = null;
            this.txtTen_Hd.Size = new Size(470, 20);
            this.txtTen_Hd.TabIndex = 1;
            this.txtTen_Hd.UserTextLength = AppInstance.TextControlLength.ItemDescription;
            this.txtTen_Hd.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtTen_Hd.Value = null;//manager.GetObject("txtTen_Hd.Value");
            this.lblTen_Hd.AutoSize = true;
            this.lblTen_Hd.Font = new Font("Arial", 8.25f);
            this.lblTen_Hd.Location = new Point(12, 0x35);
            this.lblTen_Hd.Name = "lblTen_Hd";
            this.lblTen_Hd.Size = new Size(0x4a, 14);
            this.lblTen_Hd.TabIndex = 4;
            this.lblTen_Hd.Text = "Tên hợp đồng";
            this.txtTen_Hd_E.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.txtTen_Hd_E.CheckTextSearched = false;
            this.txtTen_Hd_E.DisabledForeColor = Color.Empty;
            this.txtTen_Hd_E.Font = new Font("Arial", 8.25f);
            this.txtTen_Hd_E.Location = new Point(0x7b, 0x48);
            this.txtTen_Hd_E.MaxLength = 0x80;
            this.txtTen_Hd_E.Name = "txtTen_Hd_E";
            this.txtTen_Hd_E.OldValue = null;
            this.txtTen_Hd_E.Size = new Size(470, 20);
            this.txtTen_Hd_E.TabIndex = 2;
            this.txtTen_Hd_E.UserTextLength = AppInstance.TextControlLength.ItemDescription;
            this.txtTen_Hd_E.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtTen_Hd_E.Value = null;//manager.GetObject("txtTen_Hd_E.Value");
            this.lblTen_Hd_E.AutoSize = true;
            this.lblTen_Hd_E.Font = new Font("Arial", 8.25f);
            this.lblTen_Hd_E.Location = new Point(12, 0x4b);
            this.lblTen_Hd_E.Name = "lblTen_Hd_E";
            this.lblTen_Hd_E.Size = new Size(0x4a, 14);
            this.lblTen_Hd_E.TabIndex = 4;
            this.lblTen_Hd_E.Text = "Tên tiếng Anh";
            this.lblLoai_Hd.AutoSize = true;
            this.lblLoai_Hd.Font = new Font("Arial", 8.25f);
            this.lblLoai_Hd.Location = new Point(12, 0x61);
            this.lblLoai_Hd.Name = "lblLoai_Hd";
            this.lblLoai_Hd.Size = new Size(0x4c, 14);
            this.lblLoai_Hd.TabIndex = 4;
            this.lblLoai_Hd.Text = "Loại hợp đồng";
            this.txtLoai_Hd.CharacterCasing = CharacterCasing.Upper;
            this.txtLoai_Hd.CheckTextSearched = false;
            this.txtLoai_Hd.DisabledForeColor = Color.Empty;
            this.txtLoai_Hd.Font = new Font("Arial", 8.25f);
            this.txtLoai_Hd.InputMask = "1,2,3";
            this.txtLoai_Hd.Location = new Point(0x7b, 0x5e);
            this.txtLoai_Hd.Name = "txtLoai_Hd";
            this.txtLoai_Hd.OldValue = null;
            this.txtLoai_Hd.Size = new Size(0x17, 20);
            this.txtLoai_Hd.TabIndex = 3;
            this.txtLoai_Hd.Text = "1";
            this.txtLoai_Hd.Value = "1";
            this.txtTk.CharacterCasing = CharacterCasing.Upper;
            this.txtTk.CheckTextSearched = false;
            this.txtTk.DisabledForeColor = Color.Empty;
            this.txtTk.FieldDisplay = "Ten_Tk";
            this.txtTk.FirstFilter = "Loai_Tk = 'C'";
            this.txtTk.Font = new Font("Arial", 8.25f);
            this.txtTk.FoundIsValid = true;
            this.txtTk.Location = new Point(0x7b, 0x74);
            this.txtTk.MaxLength = 0x20;
            this.txtTk.Name = "txtTk";
            this.txtTk.OldValue = null;
            this.txtTk.Size = new Size(0x9b, 20);
            this.txtTk.TabIndex = 4;
            this.txtTk.TableName = "DMTK";
            this.txtTk.TextDisplay = this.txtTen_Tk;
            this.txtTk.UserTextLength = AppInstance.TextControlLength.ItemCode;
            this.txtTk.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtTk.Value = null;//manager.GetObject("txtTk.Value");
            this.txtTen_Tk.BackColor = SystemColors.Control;
            this.txtTen_Tk.BorderStyle = BorderStyle.None;
            this.txtTen_Tk.CheckTextSearched = false;
            this.txtTen_Tk.DisabledForeColor = Color.Blue;
            this.txtTen_Tk.Enabled = false;
            this.txtTen_Tk.Font = new Font("Arial", 8.25f);
            this.txtTen_Tk.ForeColor = Color.Blue;
            this.txtTen_Tk.Location = new Point(0x11c, 0x77);
            this.txtTen_Tk.Name = "txtTen_Tk";
            this.txtTen_Tk.OldValue = null;
            this.txtTen_Tk.Size = new Size(0x135, 13);
            this.txtTen_Tk.TabIndex = 13;
//            this.txtTen_Tk.Value = null;//manager.GetObject("txtTen_Tk.Value");
            this.lblTk.AutoSize = true;
            this.lblTk.Font = new Font("Arial", 8.25f);
            this.lblTk.Location = new Point(12, 0x77);
            this.lblTk.Name = "lblTk";
            this.lblTk.Size = new Size(0x35, 14);
            this.lblTk.TabIndex = 4;
            this.lblTk.Text = "T\x00e0i khoản";
            this.lblTk_Nt0.AutoSize = true;
            this.lblTk_Nt0.Font = new Font("Arial", 8.25f);
            this.lblTk_Nt0.ForeColor = Color.Blue;
            this.lblTk_Nt0.Location = new Point(0x98, 0x61);
            this.lblTk_Nt0.Name = "lblTk_Nt0";
            this.lblTk_Nt0.Size = new Size(250, 14);
            this.lblTk_Nt0.TabIndex = 0x21;
            this.lblTk_Nt0.Text = "1-Hợp đồng mua, 2-Hợp đồng bán, 3-Khế ước vay";
            this.lblMa_Dt.AutoSize = true;
            this.lblMa_Dt.Font = new Font("Arial", 8.25f);
            this.lblMa_Dt.Location = new Point(12, 0x8d);
            this.lblMa_Dt.Name = "lblMa_Dt";
            this.lblMa_Dt.Size = new Size(0x37, 14);
            this.lblMa_Dt.TabIndex = 4;
            this.lblMa_Dt.Text = "Đối tượng";
            this.txtMa_Dt.CharacterCasing = CharacterCasing.Upper;
            this.txtMa_Dt.CheckTextSearched = false;
            this.txtMa_Dt.DisabledForeColor = Color.Empty;
            this.txtMa_Dt.FieldDisplay = "Ten_Dt";
            this.txtMa_Dt.Font = new Font("Arial", 8.25f);
            this.txtMa_Dt.FoundIsValid = true;
            this.txtMa_Dt.Location = new Point(0x7b, 0x8a);
            this.txtMa_Dt.MaxLength = 0x20;
            this.txtMa_Dt.Name = "txtMa_Dt";
            this.txtMa_Dt.OldValue = null;
            this.txtMa_Dt.Size = new Size(0x9b, 20);
            this.txtMa_Dt.TabIndex = 5;
            this.txtMa_Dt.TableName = "DMDT";
            this.txtMa_Dt.TextDisplay = this.txtTen_Dt;
            this.txtMa_Dt.UserTextLength = AppInstance.TextControlLength.ItemCode;
            this.txtMa_Dt.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtMa_Dt.Value = null;//manager.GetObject("txtMa_Dt.Value");
            this.txtTen_Dt.BackColor = SystemColors.Control;
            this.txtTen_Dt.BorderStyle = BorderStyle.None;
            this.txtTen_Dt.CheckTextSearched = false;
            this.txtTen_Dt.DisabledForeColor = Color.Blue;
            this.txtTen_Dt.Enabled = false;
            this.txtTen_Dt.Font = new Font("Arial", 8.25f);
            this.txtTen_Dt.ForeColor = Color.Blue;
            this.txtTen_Dt.Location = new Point(0x11c, 0x8d);
            this.txtTen_Dt.Name = "txtTen_Dt";
            this.txtTen_Dt.OldValue = null;
            this.txtTen_Dt.Size = new Size(0x135, 13);
            this.txtTen_Dt.TabIndex = 13;
//            this.txtTen_Dt.Value = null;//manager.GetObject("txtTen_Dt.Value");
            this.txtNgay_Ky.DateTimeFormat = TextDate.DateTimeFormatType.Date;
            this.txtNgay_Ky.Font = new Font("Arial", 8.25f);
            this.txtNgay_Ky.InsertKeyMode = InsertKeyMode.Overwrite;
            this.txtNgay_Ky.Location = new Point(0x7b, 160);
            this.txtNgay_Ky.Mask = "00/00/0000";
            this.txtNgay_Ky.Name = "txtNgay_Ky";
            this.txtNgay_Ky.OldValue = null;
            this.txtNgay_Ky.Size = new Size(0x9b, 20);
            this.txtNgay_Ky.TabIndex = 6;
//            this.txtNgay_Ky.Value = null;//manager.GetObject("txtNgay_Ky.Value");
            this.lblNgay_Ky.AutoSize = true;
            this.lblNgay_Ky.Font = new Font("Arial", 8.25f);
            this.lblNgay_Ky.Location = new Point(12, 0xa3);
            this.lblNgay_Ky.Name = "lblNgay_Ky";
            this.lblNgay_Ky.Size = new Size(0x5f, 14);
            this.lblNgay_Ky.TabIndex = 4;
            this.lblNgay_Ky.Text = "Ngày ký hợp đồng";
            this.txtTTien0.Font = new Font("Arial", 8.25f);
            this.txtTTien0.Location = new Point(0x7b, 0xb6);
            this.txtTTien0.Name = "txtTTien0";
            int[] bits = new int[4];
            this.txtTTien0.NumericValue = new decimal(bits);
            this.txtTTien0.OldValue = null;
            this.txtTTien0.Size = new Size(0x9b, 20);
            this.txtTTien0.TabIndex = 7;
            this.txtTTien0.TextAlign = HorizontalAlignment.Right;
            this.txtTTien0.UserTextNumericFormat = AppInstance.TextNumericFormat.LocalAmount;
//            this.txtTTien0.Value = null;//manager.GetObject("txtTTien0.Value");
            this.txtTTien.Font = new Font("Arial", 8.25f);
            this.txtTTien.Location = new Point(0x7b, 0xcc);
            this.txtTTien.Name = "txtTTien";
            int[] numArray2 = new int[4];
            this.txtTTien.NumericValue = new decimal(numArray2);
            this.txtTTien.OldValue = null;
            this.txtTTien.Size = new Size(0x9b, 20);
            this.txtTTien.TabIndex = 9;
            this.txtTTien.TextAlign = HorizontalAlignment.Right;
            this.txtTTien.UserTextNumericFormat = AppInstance.TextNumericFormat.LocalAmount;
//            this.txtTTien.Value = null;//manager.GetObject("txtTTien.Value");
            this.txtNgay_Hd1.DateTimeFormat = TextDate.DateTimeFormatType.Date;
            this.txtNgay_Hd1.Font = new Font("Arial", 8.25f);
            this.txtNgay_Hd1.InsertKeyMode = InsertKeyMode.Overwrite;
            this.txtNgay_Hd1.Location = new Point(0x7b, 0xe2);
            this.txtNgay_Hd1.Mask = "00/00/0000";
            this.txtNgay_Hd1.Name = "txtNgay_Hd1";
            this.txtNgay_Hd1.OldValue = null;
            this.txtNgay_Hd1.Size = new Size(0x9b, 20);
            this.txtNgay_Hd1.TabIndex = 11;
//            this.txtNgay_Hd1.Value = null;//manager.GetObject("txtNgay_Hd1.Value");
            this.txtPT_Lai.Font = new Font("Arial", 8.25f);
            this.txtPT_Lai.Location = new Point(0x7b, 0xf8);
            this.txtPT_Lai.Name = "txtPT_Lai";
            int[] numArray3 = new int[4];
            this.txtPT_Lai.NumericValue = new decimal(numArray3);
            this.txtPT_Lai.OldValue = null;
            this.txtPT_Lai.Size = new Size(0x9b, 20);
            this.txtPT_Lai.TabIndex = 13;
            this.txtPT_Lai.TextAlign = HorizontalAlignment.Right;
            this.txtPT_Lai.UserTextNumericFormat = AppInstance.TextNumericFormat.Percent;
//            this.txtPT_Lai.Value = null;//manager.GetObject("txtPT_Lai.Value");
            this.lblTTien0.AutoSize = true;
            this.lblTTien0.Font = new Font("Arial", 8.25f);
            this.lblTTien0.Location = new Point(12, 0xb9);
            this.lblTTien0.Name = "lblTTien0";
            this.lblTTien0.Size = new Size(0x54, 14);
            this.lblTTien0.TabIndex = 4;
            this.lblTTien0.Text = "Giá trị hợp đồng";
            this.lblTTien.AutoSize = true;
            this.lblTTien.Font = new Font("Arial", 8.25f);
            this.lblTTien.Location = new Point(12, 0xcf);
            this.lblTTien.Name = "lblTTien";
            this.lblTTien.Size = new Size(0x4e, 14);
            this.lblTTien.TabIndex = 4;
            this.lblTTien.Text = "Giá trị công nợ";
            this.lblNgay_Hd1.AutoSize = true;
            this.lblNgay_Hd1.Font = new Font("Arial", 8.25f);
            this.lblNgay_Hd1.Location = new Point(12, 0xe5);
            this.lblNgay_Hd1.Name = "lblNgay_Hd1";
            this.lblNgay_Hd1.Size = new Size(80, 14);
            this.lblNgay_Hd1.TabIndex = 4;
            this.lblNgay_Hd1.Text = "Ngày thực hiện";
            this.lblPT_Lai.AutoSize = true;
            this.lblPT_Lai.Font = new Font("Arial", 8.25f);
            this.lblPT_Lai.Location = new Point(12, 0xfb);
            this.lblPT_Lai.Name = "lblPT_Lai";
            this.lblPT_Lai.Size = new Size(0x40, 14);
            this.lblPT_Lai.TabIndex = 4;
            this.lblPT_Lai.Text = "Tỷ lệ l\x00e3i vay";
            this.lblTTien_Nt0.AutoSize = true;
            this.lblTTien_Nt0.Font = new Font("Arial", 8.25f);
            this.lblTTien_Nt0.Location = new Point(0x147, 0xb9);
            this.lblTTien_Nt0.Name = "lblTTien_Nt0";
            this.lblTTien_Nt0.Size = new Size(0x4c, 14);
            this.lblTTien_Nt0.TabIndex = 4;
            this.lblTTien_Nt0.Text = "Giá trị ngoại tệ";
            this.lblTTien_Nt.AutoSize = true;
            this.lblTTien_Nt.Font = new Font("Arial", 8.25f);
            this.lblTTien_Nt.Location = new Point(0x147, 0xcf);
            this.lblTTien_Nt.Name = "lblTTien_Nt";
            this.lblTTien_Nt.Size = new Size(0x4c, 14);
            this.lblTTien_Nt.TabIndex = 4;
            this.lblTTien_Nt.Text = "Giá trị ngoại tệ";
            this.lblNgay_Hd2.AutoSize = true;
            this.lblNgay_Hd2.Font = new Font("Arial", 8.25f);
            this.lblNgay_Hd2.Location = new Point(0x147, 0xe5);
            this.lblNgay_Hd2.Name = "lblNgay_Hd2";
            this.lblNgay_Hd2.Size = new Size(0x47, 14);
            this.lblNgay_Hd2.TabIndex = 4;
            this.lblNgay_Hd2.Text = "Ngày hết hạn";
            this.lblPT_Lai1.AutoSize = true;
            this.lblPT_Lai1.Font = new Font("Arial", 8.25f);
            this.lblPT_Lai1.Location = new Point(0x147, 0xfb);
            this.lblPT_Lai1.Name = "lblPT_Lai1";
            this.lblPT_Lai1.Size = new Size(0x54, 14);
            this.lblPT_Lai1.TabIndex = 4;
            this.lblPT_Lai1.Text = "L\x00e3i vay qu\x00e1 hạn";
            this.txtNgay_Hd2.DateTimeFormat = TextDate.DateTimeFormatType.Date;
            this.txtNgay_Hd2.Font = new Font("Arial", 8.25f);
            this.txtNgay_Hd2.InsertKeyMode = InsertKeyMode.Overwrite;
            this.txtNgay_Hd2.Location = new Point(0x1b6, 0xe2);
            this.txtNgay_Hd2.Mask = "00/00/0000";
            this.txtNgay_Hd2.Name = "txtNgay_Hd2";
            this.txtNgay_Hd2.OldValue = null;
            this.txtNgay_Hd2.Size = new Size(0x9b, 20);
            this.txtNgay_Hd2.TabIndex = 12;
//            this.txtNgay_Hd2.Value = null;//manager.GetObject("txtNgay_Hd2.Value");
            this.txtTTien_Nt0.Font = new Font("Arial", 8.25f);
            this.txtTTien_Nt0.Location = new Point(0x1b6, 0xb6);
            this.txtTTien_Nt0.Name = "txtTTien_Nt0";
            int[] numArray4 = new int[4];
            this.txtTTien_Nt0.NumericValue = new decimal(numArray4);
            this.txtTTien_Nt0.OldValue = null;
            this.txtTTien_Nt0.Size = new Size(0x9b, 20);
            this.txtTTien_Nt0.TabIndex = 8;
            this.txtTTien_Nt0.TextAlign = HorizontalAlignment.Right;
            this.txtTTien_Nt0.UserTextNumericFormat = AppInstance.TextNumericFormat.ForeignAmount;
//            this.txtTTien_Nt0.Value = null;//manager.GetObject("txtTTien_Nt0.Value");
            this.txtTTien_Nt.Font = new Font("Arial", 8.25f);
            this.txtTTien_Nt.Location = new Point(0x1b6, 0xcc);
            this.txtTTien_Nt.Name = "txtTTien_Nt";
            int[] numArray5 = new int[4];
            this.txtTTien_Nt.NumericValue = new decimal(numArray5);
            this.txtTTien_Nt.OldValue = null;
            this.txtTTien_Nt.Size = new Size(0x9b, 20);
            this.txtTTien_Nt.TabIndex = 10;
            this.txtTTien_Nt.TextAlign = HorizontalAlignment.Right;
            this.txtTTien_Nt.UserTextNumericFormat = AppInstance.TextNumericFormat.ForeignAmount;
//            this.txtTTien_Nt.Value = null;//manager.GetObject("txtTTien_Nt.Value");
            this.txtPT_Lai1.Font = new Font("Arial", 8.25f);
            this.txtPT_Lai1.Location = new Point(0x1b6, 0xf8);
            this.txtPT_Lai1.Name = "txtPT_Lai1";
            int[] numArray6 = new int[4];
            this.txtPT_Lai1.NumericValue = new decimal(numArray6);
            this.txtPT_Lai1.OldValue = null;
            this.txtPT_Lai1.Size = new Size(0x9b, 20);
            this.txtPT_Lai1.TabIndex = 14;
            this.txtPT_Lai1.TextAlign = HorizontalAlignment.Right;
            this.txtPT_Lai1.UserTextNumericFormat = AppInstance.TextNumericFormat.Percent;
//            this.txtPT_Lai1.Value = null;//manager.GetObject("txtPT_Lai1.Value");
            base.AddTitleText = "Thêm mới hợp đồng";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.ClientSize = new Size(610, 0x130);
            base.Controls.Add(this.txtPT_Lai1);
            base.Controls.Add(this.txtPT_Lai);
            base.Controls.Add(this.txtTTien_Nt);
            base.Controls.Add(this.txtTTien);
            base.Controls.Add(this.txtTTien_Nt0);
            base.Controls.Add(this.txtTTien0);
            base.Controls.Add(this.txtNgay_Hd2);
            base.Controls.Add(this.txtNgay_Hd1);
            base.Controls.Add(this.txtNgay_Ky);
            base.Controls.Add(this.lblTk_Nt0);
            base.Controls.Add(this.txtTen_Dt);
            base.Controls.Add(this.txtTen_Tk);
            base.Controls.Add(this.txtMa_Dt);
            base.Controls.Add(this.txtTk);
            base.Controls.Add(this.txtLoai_Hd);
            base.Controls.Add(this.lblTen_Hd_E);
            base.Controls.Add(this.lblPT_Lai1);
            base.Controls.Add(this.lblLoai_Hd);
            base.Controls.Add(this.lblNgay_Hd2);
            base.Controls.Add(this.lblPT_Lai);
            base.Controls.Add(this.lblTTien_Nt);
            base.Controls.Add(this.lblNgay_Hd1);
            base.Controls.Add(this.lblTTien_Nt0);
            base.Controls.Add(this.lblTTien);
            base.Controls.Add(this.lblTTien0);
            base.Controls.Add(this.lblNgay_Ky);
            base.Controls.Add(this.lblMa_Dt);
            base.Controls.Add(this.lblTen_Hd);
            base.Controls.Add(this.lblTk);
            base.Controls.Add(this.lblMa_Hd);
            base.Controls.Add(this.txtTen_Hd_E);
            base.Controls.Add(this.txtTen_Hd);
            base.Controls.Add(this.txtMa_Hd);
            base.EditTitleText = "Sửa hợp đồng";
            base.FirstFreeCode = "HD1";
            base.Name = "FormDmHdEditor";
            base.SecondFreeCode = "HD2";
            this.Text = "Thêm mới hợp đồng";
            base.ThirdFreeCode = "HD3";
            base.Controls.SetChildIndex(base.lblPhan_Loai, 0);
            base.Controls.SetChildIndex(base.txtMa_Loai1, 0);
            base.Controls.SetChildIndex(base.txtMa_Loai2, 0);
            base.Controls.SetChildIndex(base.txtMa_Loai3, 0);
            base.Controls.SetChildIndex(this.txtMa_Hd, 0);
            base.Controls.SetChildIndex(this.txtTen_Hd, 0);
            base.Controls.SetChildIndex(this.txtTen_Hd_E, 0);
            base.Controls.SetChildIndex(this.lblMa_Hd, 0);
            base.Controls.SetChildIndex(this.lblTk, 0);
            base.Controls.SetChildIndex(this.lblTen_Hd, 0);
            base.Controls.SetChildIndex(this.lblMa_Dt, 0);
            base.Controls.SetChildIndex(this.lblNgay_Ky, 0);
            base.Controls.SetChildIndex(this.lblTTien0, 0);
            base.Controls.SetChildIndex(this.lblTTien, 0);
            base.Controls.SetChildIndex(this.lblTTien_Nt0, 0);
            base.Controls.SetChildIndex(this.lblNgay_Hd1, 0);
            base.Controls.SetChildIndex(this.lblTTien_Nt, 0);
            base.Controls.SetChildIndex(this.lblPT_Lai, 0);
            base.Controls.SetChildIndex(this.lblNgay_Hd2, 0);
            base.Controls.SetChildIndex(this.lblLoai_Hd, 0);
            base.Controls.SetChildIndex(this.lblPT_Lai1, 0);
            base.Controls.SetChildIndex(this.lblTen_Hd_E, 0);
            base.Controls.SetChildIndex(this.txtLoai_Hd, 0);
            base.Controls.SetChildIndex(this.txtTk, 0);
            base.Controls.SetChildIndex(this.txtMa_Dt, 0);
            base.Controls.SetChildIndex(this.txtTen_Tk, 0);
            base.Controls.SetChildIndex(this.txtTen_Dt, 0);
            base.Controls.SetChildIndex(this.lblTk_Nt0, 0);
            base.Controls.SetChildIndex(this.txtNgay_Ky, 0);
            base.Controls.SetChildIndex(this.txtNgay_Hd1, 0);
            base.Controls.SetChildIndex(this.txtNgay_Hd2, 0);
            base.Controls.SetChildIndex(this.txtTTien0, 0);
            base.Controls.SetChildIndex(this.txtTTien_Nt0, 0);
            base.Controls.SetChildIndex(this.txtTTien, 0);
            base.Controls.SetChildIndex(this.txtTTien_Nt, 0);
            base.Controls.SetChildIndex(this.txtPT_Lai, 0);
            base.Controls.SetChildIndex(this.txtPT_Lai1, 0);
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        protected override void OnReset()
        {
            if (base.LocalCurrentRow != null)
            {
                if (!base.NewChecked)
                {
                    this.txtTTien_Nt0.Value = base.LocalCurrentRow["TTien_Nt0"];
                    this.txtTTien0.Value = base.LocalCurrentRow["TTien0"];
                    this.txtTTien_Nt.Value = base.LocalCurrentRow["TTien_Nt"];
                    this.txtTTien.Value = base.LocalCurrentRow["TTien"];
                    this.txtPT_Lai.Value = base.LocalCurrentRow["PT_Lai"];
                    this.txtPT_Lai1.Value = base.LocalCurrentRow["PT_Lai1"];
                }
                else
                {
                    this.txtTTien_Nt0.Value = SDBNull.Value;
                    this.txtTTien0.Value = SDBNull.Value;
                    this.txtTTien_Nt.Value = SDBNull.Value;
                    this.txtTTien.Value = SDBNull.Value;
                    this.txtPT_Lai.Value = SDBNull.Value;
                    this.txtPT_Lai1.Value = SDBNull.Value;
                }
                base.OnReset();
            }
        }

        public override bool OnSave()
        {
            DataRow localCurrentRow;
            if (string.IsNullOrEmpty(this.txtMa_Hd.Text))
            {
                MessageBox.Show("Chưa nhập mã hợp đồng!", AppInstance.SoftwareName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return false;
            }
            if (string.IsNullOrEmpty(this.txtTen_Hd.Text))
            {
                MessageBox.Show("Chưa nhập tên hợp đồng!", AppInstance.SoftwareName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return false;
            }
            if (string.IsNullOrEmpty(this.txtMa_Dt.Text))
            {
                MessageBox.Show("Chưa nhập mã đối tượng!", AppInstance.SoftwareName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return false;
            }
            if (string.IsNullOrEmpty(this.txtTk.Text))
            {
                MessageBox.Show("Chưa nhập tài khoản!", AppInstance.SoftwareName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return false;
            }
            if (this.txtNgay_Ky.Value == SDBNull.Value)
            {
                MessageBox.Show("Chưa nhập ngày ký hợp đồng!", AppInstance.SoftwareName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return false;
            }
            if (base.NewChecked)
            {
                localCurrentRow = base.LocalTable.NewRow();
                localCurrentRow["Stt"] = SSDataAccess.Cong_So_Tt(AppInstance.Subsidiary);
            }
            else
            {
                localCurrentRow = base.LocalCurrentRow;
            }
            localCurrentRow["Ma_Hd"] = this.txtMa_Hd.Value;
            localCurrentRow["Ten_Hd"] = this.txtTen_Hd.Value;
            localCurrentRow["Ten_Hd_E"] = this.txtTen_Hd_E.Value;
            localCurrentRow["Loai_Hd"] = this.txtLoai_Hd.Value;
            localCurrentRow["Tk"] = this.txtTk.Value;
            localCurrentRow["Ten_Tk"] = this.txtTen_Tk.Value;
            localCurrentRow["Ma_Dt"] = this.txtMa_Dt.Value;
            localCurrentRow["Ten_Dt"] = this.txtTen_Dt.Value;
            localCurrentRow["Ngay_Ky"] = this.txtNgay_Ky.Value;
            localCurrentRow["TTien_Nt0"] = this.txtTTien_Nt0.Value;
            localCurrentRow["TTien0"] = this.txtTTien0.Value;
            localCurrentRow["TTien_Nt"] = this.txtTTien_Nt.Value;
            localCurrentRow["TTien"] = this.txtTTien.Value;
            localCurrentRow["PT_Lai"] = this.txtPT_Lai.Value;
            localCurrentRow["PT_Lai1"] = this.txtPT_Lai1.Value;
            localCurrentRow["Ngay_Hd1"] = this.txtNgay_Hd1.Value;
            localCurrentRow["Ngay_Hd2"] = this.txtNgay_Hd2.Value;
            localCurrentRow["Ma_Loai1"] = base.txtMa_Loai1.Value;
            localCurrentRow["Ma_Loai2"] = base.txtMa_Loai2.Value;
            localCurrentRow["Ma_Loai3"] = base.txtMa_Loai3.Value;
            DmHdDataAccess access = new DmHdDataAccess();
            if (base.ShowMessage(localCurrentRow, access.SaveRow(base.NewChecked, localCurrentRow)))
            {
                return false;
            }
            if (base.NewChecked)
            {
                base.LocalTable.Rows.Add(localCurrentRow);
            }
            base.LocalCurrentRow = localCurrentRow;
            base.LocalTable.AcceptChanges();
            this.txtMa_Hd.Focus();
            return base.OnSave();
        }

        public override void OnShow()
        {
            this.txtMa_Hd.Value = base.LocalCurrentRow["Ma_Hd"];
            this.txtTen_Hd.Value = base.LocalCurrentRow["Ten_Hd"];
            this.txtTen_Hd_E.Value = base.LocalCurrentRow["Ten_Hd_E"];
            this.txtLoai_Hd.Value = base.LocalCurrentRow["Loai_Hd"];
            this.txtTk.Value = base.LocalCurrentRow["Tk"].ToString();
            this.txtTen_Tk.Value = base.LocalCurrentRow["Ten_Tk"];
            this.txtMa_Dt.Value = base.LocalCurrentRow["Ma_Dt"];
            this.txtTen_Dt.Value = base.LocalCurrentRow["Ten_Dt"];
            this.txtNgay_Ky.Value = base.LocalCurrentRow["Ngay_Ky"];
            this.txtNgay_Hd1.Value = base.LocalCurrentRow["Ngay_Hd1"];
            this.txtNgay_Hd2.Value = base.LocalCurrentRow["Ngay_Hd2"];
            base.txtMa_Loai1.Value = base.LocalCurrentRow["Ma_Loai1"];
            base.txtMa_Loai2.Value = base.LocalCurrentRow["Ma_Loai2"];
            base.txtMa_Loai3.Value = base.LocalCurrentRow["Ma_Loai3"];
            base.OnShow();
        }
    }
}

